﻿use csyzsql
go

declare @tb varchar(50)
declare @sql varchar(4000)
declare c cursor for   select name from sysobjects where xtype='U'
open c
fetch next from c into @tb
while @@fetch_status=0
begin
	--print @tb
	select @sql='select * from csyzsql..['+ @tb+'] except select * from csyz...['+@tb+']'
	--print @sql
	exec(@sql)
	fetch next from c into @tb
end   
close c
deallocate c